/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.jbeacon.baseutil;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.io.IOException;

/**
 * <B>说       明<B>: JSON处理工具类
 * @author  作  者  名：张日雄 <br>
 *          E-mail ：827935210@qq.com<br>
 * @date    创建时间： 2016-7-30 16:10:22<br>
 * @version 版   本  号：V1.0<br>
 */
public final class JsonUtil {
        
    /**
     * 根据json字符、指定的外层key、外层key中的key获取外层key中的key对应的value（这么拗口） 
     * String json ="{\"Code\":1000,\"DataList\":[{\"Rate\":0,\"Time\":\"2015-08-06 17:11:09\"}]}"
     * JsonNode jsonStr = JsonUtil.getChildJsonValue(json, "DataList","Time"); 
     * 得到jsonStr = 2015-08-06 17:11:09
     * @param json
     * @param parent
     * @param child
     * @return 
     */
    public static JsonNode getChildJsonValue(String json, String parent,
                    String child) {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    public static JsonNode getJsonValue(String json, String key) {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    public static ArrayNode createArrayNode() {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    public static ObjectNode createObjectNode() {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    /**
     * @param <T>
     * @param jsonStr
     * @param collectionClass
     * @param elementClasses
     * @return
     * @throws IOException 
     */
    public static <T> T jsonToObject(String jsonStr, Class<?> collectionClass,
                    Class<?>... elementClasses) throws IOException {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    /**
     * 
     * @param <T>
     * @param jsonString
     * @param valueType
     * @return 
     */
    public static <T> T jsonToObject(String jsonString, Class<T> valueType){
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
                
    /**
     * 字符串转换Json 
     * @param input
     * @return 
     */
    public static JsonNode parseJson(String input) {
       throw new UnsupportedOperationException("UnsupportedOperationException");     
    }
    
    /**
     * json转字符串
     * @param pojo
     * @return 
     */
    public static String toJsonString(Object pojo) {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    /**
     * 
     * @return 
     */
    public static ObjectMapper getMapper() {
        throw new UnsupportedOperationException("UnsupportedOperationException");
    }
    
    /**
     * ObjectMapper 提供单例供全局使用
     */
    private static class SingletonHolder {
        
    }
    
    //工具类构造函数私有化
    private JsonUtil() {
    }
    
}
